<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            align-items: center;
            width: 300px;
            height: 300px;
            background-color: aqua;
        }
        .b1{
            width: 100px;
            height: 100px;
            background-color: blanchedalmond;
        }
        .b2{
            width: 50px;
            height: 50px;
            background-color: rebeccapurple;
        }
        .b3{
            width: 20px;
            height: 20px;
            background-color: rgb(255, 255, 255);
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="b1">
         <div class="b2">
            
         </div>
        </div>
    </div>
    <script>
        let box =document.querySelector('.box')
        let b1 =document.querySelector('.b1')
        let b2 =document.querySelector('.b2')
        let b3 =document.querySelector('.b3')
        box.addEventListener('click',function(){
            alert('父盒子')
        })
        b1.addEventListener('click',function(e){
            alert('子1')
            e.stopPropagation()
        })
        b2.addEventListener('click',function(){
            alert('子2')
            
        })
       
    </script>
</body>
</html>